package com.school_admin.util;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Component
public class CreateTime {
    public String  getTime(){
        // 生成当前日期
        LocalDateTime currentTime = LocalDateTime.now();
        // 日期格式化
        return currentTime.format( DateTimeFormatter.
                ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
}
